<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="txt" type="text">
<input id="btn" type="button" value="创建">
<hr>
<ul id="ul">

</ul>
</body>
</html>
<script type="text/javascript">
    var obj = document.getElementById("ul");
    document.getElementById("btn").onclick = function (ev) {
        var liobj = document.createElement("li");
        var aobj = document.createElement("a")
        liobj.innerHTML = document.getElementById("txt").value;
        aobj.innerHTML = "http://www.baidu.com"
        liobj.appendChild(aobj)
        obj.appendChild(liobj);
    };
</script>